package letsjava.utils;

import org.apache.log4j.Logger;

public class NSLog {
	public static String rootPath = System.getProperty("user.dir"); 
	public static void error(String a) throws Exception{
		NSFile.append(rootPath+"/data/log/error.log","["+NSUtil.getDate()+"]"+NSDebug.debugStr()+a);
	}
	public static void info(String a) throws Exception{
		NSFile.append(rootPath+"/data/log/info.log","["+NSUtil.getDate()+"]"+NSDebug.debugStr()+a);
	}
	
	public static void log4j(String a){
		String path=rootPath + "/src/log4j.properties"; 
		org.apache.log4j.PropertyConfigurator.configure(path); 
		Logger logger = Logger.getLogger(NSLog.class); 
		logger.debug(a); 
		logger.error(a);
		logger.info(a);
	}
	
	public static void main(String[] args){
		NSLog.log4j("aaaa");
	}
}
